{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "e54793a9",
   "metadata": {
    "scrolled": false,
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "         :: Aestate Framework ::      (version:1.0.5a2)\n",
      "    +    __                    _        _        __    +\n",
      "    +   / /     /\\            | |      | |       \\ \\   +\n",
      "    +  / /     /  \\   ___  ___| |_ __ _| |_ ___   \\ \\  +\n",
      "    + | |     / /\\ \\ / _ \\/ __| __/ _` | __/ _ \\   | | +\n",
      "    +  \\ \\   / ____ \\  __/\\__ \\ || (_| | ||  __/  / /  +\n",
      "========\\_\\=/_/====\\_\\___||___/\\__\\__,_|\\__\\___|=/_/========\n",
      "\n"
     ]
    }
   ],
   "source": [
    "from demoModels import Demo\n",
    "demo = Demo()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "64abd951",
   "metadata": {
    "scrolled": true,
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001B[0;;36m2021-12-09 12:45:02.565970 \u001B[0m\u001B[0;;32m INFO\u001B[0m   86\u001B[0;;31m 0x7fdb8a3ffa58\u001B[0m [\u001B[0;;34m   ASQL\u001B[0m] \u001B[0;;91maestate.opera.DBPool.pooled_db.PooledDedicatedDBConnection\u001B[0m :  SELECT `name`,`password`,`id`,`create_time`,`update_time` FROM demo\n",
      "[\n",
      "    {\n",
      "        \"create_time\":\"2021-12-09 12:43:26\",\n",
      "        \"id\":2,\n",
      "        \"name\":\"tttt\",\n",
      "        \"password\":\"465132\",\n",
      "        \"update_time\":\"2021-12-09 12:43:26\"\n",
      "    },\n",
      "    {\n",
      "        \"create_time\":\"2021-12-09 12:43:26\",\n",
      "        \"id\":2,\n",
      "        \"name\":\"tttt\",\n",
      "        \"password\":\"465132\",\n",
      "        \"update_time\":\"2021-12-09 12:43:26\"\n",
      "    }\n",
      "]\n"
     ]
    }
   ],
   "source": [
    "r1 = demo.find_all(print_sql=True)\n",
    "print(r1.to_json(bf=True))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7445a168",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<demoModels.Demo at 0x7fdb98074940>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r1.first()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "657aafef",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<demoModels.Demo at 0x7fdb98074940>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r1.last()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "86e996b4",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}